<html lang="en">
<head>
    <meta charset="UTF-8">
    <title>Document</title>
    <script>
       var str ='';
        for(var i=1;i<=8;i++){
          for(var j=1;j<=i;j++){
            str=str+'*';
        }
        str+='\n'; //换行
    }
        console.log(str);  //打印
    </script>
    </head>
    </html>